home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Compilers⁄Interps / GCC-2.3.3r12 / Release Notes < prev   
Encoding:
Text File  |  1993-11-19  |  13.5 KB  |  363 lines  |  [TEXT/MPS ]

  1. RELEASE NOTES FOR MPW GCC 2.3.3r12
  2.  
  3. ***WARNING***
  4. THIS IS A PRE-RELEASE INTENDED FOR EXPERIMENTATION AND EVALUATION ONLY!
  5. THERE ARE KNOWN TO BE CODE GENERATION BUGS INVOLVING PASCAL-DECLARED FUNCTIONS
  6. THAT WILL TRASH THE STACK AND EVERYTHING ELSE!
  7. ***WARNING***
  8.  
  9. INSTALLATION
  10.  
  11. [this is inaccurate and will change anyway]
  12. To install GCC, set the current directory to the distribution gcc directory (which is
  13. most likely the directory you got these notes from). Execute
  14. the script "InstallGCC". You will be asked for the directory you want the
  15. tools (cc1_<xxx>, cpp_<xxx>, gcc_driver, shorten) to be placed.
  16. Then you will be asked for the directory you
  17. want the scripts (gC, gCPlus) to be placed. The default directories are
  18. {MPW}Tools: and {MPW}Scripts: respectively.
  19. [describe options to InstallGCC eventually]
  20.  
  21. CHANGING THE SHELL
  22.  
  23. The MPW partition size will need to be rather large; 3000K is often enough,
  24. but the exact value will depend on the size and complexity of what you're compiling.
  25. [what is the min needed for self-compilation?  would be a good standard]
  26.  
  27. ************* DO THIS!! ************-----    -----*********** DO THIS!! ************
  28.                                          \  /
  29.                                           \/
  30. Also, the MPW stack MUST BE INCREASED to 128K. This is done by editing the HEXA 128
  31. resource of the shell to be "0002 0000" (it's normally "0001 0000").  If you neglect
  32. this, GCC will quite likely overflow the stack and crash your Mac in some mysterious
  33. way.                                      /\
  34.                                          /  \
  35. ************* DO THIS!! ************-----    -----*********** DO THIS!! ************
  36.  
  37. (This is because GCC makes heavy use of a "true alloca" that does temporary
  38. allocation on the stack; very efficient, but sometimes uses huge amounts
  39. of stack space.  We haven't yet encountered any program for which GCC needed more
  40. than 128K of stack, but your mileage may vary.  Note that this is not a problem
  41. for GCC when compiled by MPW C (the "Stage 1" build); it uses a "fake alloca" based
  42. on malloc and frame pointer trickery.)
  43.  
  44. INSTALLING THE DOCUMENTATION
  45.  
  46. The help files GCC.Help may be appended to MPW.Help, or else accessed using the
  47. -f option to help.  There are Commando resources in the scripts as well.
  48.  
  49. The Manual-≈ directories contain the long manuals.
  50.  
  51. CCCP (the preprocessor) and GCC each have their own manuals which are in TeX format.
  52. Both the commercial Mac application Textures and the shareware program
  53. OzTeX can format and print the manuals, as long as the TeX macro file texinfo.tex
  54. (also in Manual-Texi) is available.  TeX is also available on many other machines.
  55.  
  56. If you don't have TeX, the TeX input files ≈.texi are readable, if somewhat ugly.
  57.  
  58. USING GCC
  59.  
  60. This GCC port has been designed to fit as smoothly as possible into the MPW
  61. environment.  Once GCC has been installed, you need only change the name of
  62. the C compiler from "C" to "gC".  All of the usual MPW include files and libraries
  63. should work exactly the same as with MPW C; please let me know when they don't!
  64.  
  65. There are some known differences between GCC and MPW C:
  66.  
  67. * Some MPW C options are not implemented by GCC.  See GCC.Help for the exact list
  68. of what is available.  Any options not listed are not supported.
  69.  
  70. * All GCC options are CaSe SeNsItIvE!  MPW C-compatible options must always be
  71. all-lower-case in GCC.
  72.  
  73. * The dump and load pragmas are not supported.  Their presence will
  74. not cause an error however.
  75.  
  76. * The preprocessor symbol __DUMP__ is always undefined.
  77.  
  78. * The preprocessor symbol __SEG__ cannot be used to set the segment.
  79.  
  80. * The preprocessor symbol "mpwgcc" is defined.
  81.  
  82. * The "comp" type is recognized and has code generated for it, but the
  83. library routines are presently undefined.
  84.  
  85. * -sym options are just passed on to the MPW assembler, so source-level debuggers won't be
  86. that useful with your code.
  87.  
  88. * -mbg ch8 and -mbg <number> are not implemented.
  89.  
  90. * Since GCC produces code that is processed by the MPW Assembler, any C symbols
  91. that are the same as the names of 68xxx registers (d0, sp, caar, etc) must be
  92. changed to something else.  GCC will postpend an underscore (_) and issue a warning
  93. that this is being done.  If all of your program is being compiled by GCC, there
  94. shouldn't be any problems, but if you mix MPW C and GCC code, then you may get
  95. linker errors, and must modify your source code to use different symbols.
  96.  
  97. * GCC will often issue library calls to handle operations such as multiplies and
  98. block moves.  If you don't link in libraries like StdCLib.o and Runtime.o, you may
  99. get complaints from the linker that certain functions are undefined, even though
  100. you don't call them explicitly in the source code.
  101.  
  102. * A number of MPW bugs and sloppinesses are missing from GCC.  Although this is
  103. generally good, you may find that GCC complains about a number of situations that
  104. MPW accepts silently.
  105.  
  106. * A common instance of this is when GCC complains about
  107.   void foo(short); ... void foo(x) short x; { ... }
  108. This really is incorrect code, but MPW won't complain.  GCC has been changed to
  109. only issue a warning rather than an error in these cases, but you can expect to
  110. see a lot of these.
  111.  
  112. * Another important example is the -n flag, which doesn't just convert pointer
  113. usage errors into warnings, it actually silences MPW C entirely!  This can lead
  114. to serious pointer arithmetic mistakes being accepted, including ones that GCC
  115. cannot possibly deal with.
  116.  
  117. ADDITIONAL FEATURES OF GCC
  118.  
  119. There are dozens of additional options and features in GCC, which I will only
  120. summarize here.  See the GCC.Help file for short cryptic descriptions of the command
  121. options and the GCC manual for long elaborate explanations.  Also, the Commando 
  122. interface is a convenient tour of all the options.
  123.  
  124. GCC also features additional language constructs that are unique to it.
  125. These constructs include statements and declarations inside of
  126. expressions, named expression type, typeof, alignof, generalized lvalues, arrays of
  127. variable length, nonconstant initializers, constructor expressions, function
  128. inlining, and inline assembly code.  Note that these nice new constructs are
  129. not in MPW C, which will usually fail on them; the gC option -pedantic will
  130. issue warnings when any of these appear in your code.  If you really really want
  131. to use these but also want to have portable code, they should be ifdefed.
  132.  
  133. Additional GCC command options include the ability to generate assembly language output,
  134. optional optimization, a number of controls over warning messages, and a number of
  135. controls over compilation technique.
  136.  
  137. Optimization in GCC is extremely good.  On the 680x0, GCC will do excellent
  138. register allocation, in addition to maximally exploiting addressing modes.
  139. (A dramatic example is the inner loop of Mandelbrot calculation - GCC will use
  140. all eight FPx registers for temporaries.)  It does tend to favor code speed
  141. over size.  Some parts of the Mac interface are done awkwardly and/or slowly
  142. (such as non-68881 SANE calls and pascal returns).
  143.  
  144. USING C++
  145.  
  146. The script gCPlus is an approximate implementation of MPW C++.  It works by
  147. running CFront with options set to produce text output, then invoking gC on
  148. the result.  MPW C++ and C++ in general are moving targets, so you're more likely
  149. to run into incompatibilities and other problems (static constructors and
  150. destructors are sometimes a hassle, for instance).
  151.  
  152. FURTHER READING
  153.  
  154. Both the compiler and preprocessor have their own manuals, which are in TeX
  155. format.  [describe or xref how to print these]
  156.  
  157. The most useful parts are those describing the extra command options in detail
  158. (since the manual was written for Unix GCC, many of the option names are different,
  159. so watch out), and the sections describing GCC's extensions to C.
  160.  
  161. IF gC CRASHES
  162.  
  163. When the compiler runs into trouble, it will generally calls fancy_abort, which goes
  164. into Macsbug.  "g" usually gets you back to MPW safely.  This should never occur for
  165. the standard compiler; please report any occurrences, ideally including the source
  166. file and command options responsible.  GCC may occasionally produce code that the
  167. MPW Assembler will choke on; again, this shouldn't happen and should be reported
  168. when it does.  As a convenience when this happens, gC will leave the asm file
  169. around rather than deleting it.
  170.  
  171. Known problems with GCC are listed below.  Fixes and/or suggestions
  172. to solve any of these problems will be gratefully accepted and incorporated into
  173. future releases of MPW GCC.
  174.  
  175. ROAD MAP
  176.  
  177. The GCC source tree is huge.  Fortunately, much of it is documentation and
  178. support for obscure systems.  The Unix version puts everything in one
  179. main directory and just a couple subdirectories.  This does not work
  180. well on the Mac, so MPW GCC uses an organization with many more
  181. subdirectories.
  182.  
  183. The basic distribution includes the following items.
  184.  
  185. :Release Notes        This document.
  186.  
  187. :Install            Installer script for MPW GCC.
  188.  
  189. :Scripts:            Scripts for using MPW GCC.
  190.  
  191. :Tools:                Tools invoked by the scripts.
  192.  
  193. :GCC.Help            MPW-style command option help.
  194.  
  195. :Documents:            Essential FSF GCC documents.
  196.  
  197. :Manual-DVI:        Manuals for GCC and CPP, in DVI form.
  198.  
  199. :Manual-Info:        Manuals for GCC and CPP, in Info File form.
  200.  
  201. :Manual-Texi:        Texinfo sources for GCC and CPP manuals.
  202.  
  203. The following directories are only included with the basic source distribution.
  204.  
  205. :Build:                Scripts used to build all versions of MPW GCC.
  206.  
  207. :Sources:            All non-language-specific sources.
  208.  
  209. :Sources-Apple:        Files added by Apple.
  210.  
  211. :Sources-C:            C frontend sources.
  212.  
  213. :Sources-CPlus:        C++ frontend sources.
  214.  
  215. :Targets:            All the target machines.
  216.  
  217. :Targets:<xxx>:        All the sources for target machine xxx.
  218.  
  219. :Tests:                A set of test cases and small benchmarks.
  220.  
  221. The following directories are only included with the full source distribution.
  222.  
  223. :ChangeLogs:        Full FSF change logs.
  224.  
  225. :Documents-Misc:    Random document files, mostly irrelevant to the Mac.
  226.  
  227. :Misc:                This contains miscellaneous things, mostly scripts for
  228.                     Unix, VMS, and MS-DOS.
  229.  
  230. :Sources-Misc:        Miscellaneous sources not used in MPW GCC,
  231.                     mostly sources for tools that are only useful in Unix.
  232.  
  233. :Sources-ObjC:        Objective C frontend sources.
  234.  
  235. :Sources-Targets:    All the sources for machine targets.
  236.  
  237. The following directories are not normally distributed, but are constructed
  238. automatically during builds.
  239.  
  240. :Stage[1234]-<xxx>:    These are for the different stages and target machines
  241.                     needed during the build process.
  242.  
  243.  
  244. KNOWN BUGS
  245.  
  246. Some of the descriptions below are garbled, sorry.
  247.  
  248. The compiler generates bad code for some pascal-declared calls.
  249. (return size is wrong with prototype for non-long sizes
  250. pushes and pulls bytes off stack wrong
  251. pascal typedef globals (values) aren't coming out as pascal type (not uppercase))
  252.  
  253. Command-line arguments should be allowed to be in any case.
  254.  
  255. Terrible junk is created by saving/restoring about ULMULT and friends.
  256.  
  257. Multiple levels of function inlining seems to defeat frame pointer omission.
  258.  
  259. gCPlus is still a script rather than driver-based, slows it down.
  260.  
  261. Should detect and warn if FPU not present, instead of crashing mysteriously.
  262.  
  263. Initializing a local variable that is a structure makes global data
  264. when it would be better not to.
  265.  
  266. Data copying should use an inline dbra loop rather than calling memcpy
  267. always (should be selectable actually).
  268.  
  269. Some Unix-syntax options are rejected unnecessarily.
  270.  
  271. Need an option to return shorts instead of ints from functions declared to
  272. return shorts - similarly to what happens when a function is declared "pascal",
  273. but without the other effects.
  274.  
  275. Very long direct fns may exceed 25-arg limit on DC.Ws in asm code.
  276.  
  277. When -finline-functions is used, not all needed symbols are created
  278. and imported.
  279.  
  280. Some sorts of conversions (such as double <-> extended) cause a crash in
  281. the reload phase.  Seems to be more common with optimization+SANE+extended
  282. floats, but has been observed in other situations also.
  283. Example (OK with -mc68881, fails without):
  284.     int n, i, arr[10];
  285.     float c, theta, tang;
  286.     test() {
  287.       for (i = 0; i < n; i++) {
  288.         tang = atan2 (cos (i * 2.0), sin (i * 2.0));
  289.         arr[i] = 50 * c * sin (tang);  }}
  290. Workaround: temp variables and multiple assignment statements seem to help.
  291.  
  292. #<symbol> sometimes appears as an operand (as when pointer arithmetic is being
  293. done on the address of an array), causing MPW Asm to report an error.
  294. Example:
  295.     extern char gline[100], *fooline;
  296.     foo() { return fooline - gline; }
  297. Workaround: assign address to a temp pointer, then do operations on value of ptr.
  298.  
  299. Casted objects passed by address to pascal functions don't get converted.
  300.  
  301. Pointer to a function does not have the right sort of value
  302. Example:
  303.     void f();
  304.     void (*fp)() = f;
  305.     foo() { return *fp == f; }  /* returns 0, but should return 1 */
  306.  
  307. (Incorrect code gen for C code defined as pascal fn returning structs?)
  308.  
  309. Complains about mismatches between ptrs to chars and unsigned chars
  310. (Mac read() proto vs cccp.c, for instance).
  311.  
  312. CHANGE LOG
  313.  
  314. 2.3.3r10:
  315.  
  316. Fixed bug with multiple -i options.
  317.  
  318. Fixed -opt branch bugs that lost real asm errors,
  319. and fixed to not spin on negative line numbers from asm.
  320.  
  321. Hacked randomly on "symbols as address constants" handling.
  322.  
  323. 2.3.3r9:
  324.  
  325. Added talking compiler silliness.
  326.  
  327. Fixed interaction between -b option and segment stuff.
  328.  
  329. 2.3.3r8:
  330.  
  331. 2.3.3r7:
  332.  
  333. 2.3.3r6:
  334.  
  335. Changed handling of pascal and parameter pragmas; they now create distinct
  336. function types.
  337.  
  338. Simplified and streamlined many of the patches, while keeping them
  339. semantically equivalent.
  340.  
  341. 2.3.3r5:
  342.  
  343. Added PowerPC target.
  344.  
  345. Folded in Brent's r4 changes.
  346.  
  347. Much reorganization and renaming, in directories, files and scripts.
  348. Added a top-level BuildGCC script and made InstallGCC capable of
  349. forcing a build if desired.
  350.  
  351. 2.3.3r4:
  352.  
  353. Hacks to make cc1plus work.
  354.  
  355. 2.3.3r3:
  356.  
  357. (Never existed?)
  358.  
  359. 2.3.3r2:
  360.  
  361. 2.3.3:
  362.  
  363. First port of 2.3.3 to the Mac.